FROM library/ubuntu:24.04
#拷贝字体
COPY ./typeface/simsun.ttc /usr/share/fonts/simsun.ttc
#ENV LANG="zh_CN.UTF-8"
ENV LANG="en_US.UTF-8"
RUN echo "deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse" > /etc/apt/sources.list && \
  echo "deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse" >> /etc/apt/sources.list && \
  echo "deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse" >> /etc/apt/sources.list && \
  echo "deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse" >> /etc/apt/sources.list && \
  echo "deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse" >> /etc/apt/sources.list && \
  echo "deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse" >> /etc/apt/sources.list && \
  echo "deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse" >> /etc/apt/sources.list && \
  echo "deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse" >> /etc/apt/sources.list && \
  # 更新APT包列表。
  apt-get update && \
  # 安装curl。
  apt-get install -y --no-install-recommends curl && \
  # 清理已经下载的软件包文件。
  apt-get clean && \
  ## 删除APT的软件包列表缓存，进一步释放空间。
  rm -rf /var/lib/apt/lists/*

#字体
RUN apt-get update --fix-missing -o Acquire::http::No-Cache=True \
    && apt install -y  wget  curl  iproute2   fontconfig  tzdata  \
    && fc-cache -f -v   \
    && fc-list \
    && apt-get clean  \
    && rm -rf /var/lib/apt/lists/*

RUN rm -rf /etc/localtime  \
    && ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && echo "Asia/Shanghai" > /etc/timezone  && mkdir  -p /apps
WORKDIR /usr/local 
COPY jdk1.8.0_192.tar.gz    ./
RUN   tar -xf  jdk1.8.0_192.tar.gz  \
&&  rm   -rf jdk1.8.0_192.tar.gz
WORKDIR /apps
ENV JAVA_HOME=/usr/local/jdk1.8.0_192
ENV CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
ENV PATH=$JAVA_HOME/bin:$PATH
ENV JAVA_TOOL_OPTIONS="-XX:+UseContainerSupport  -XX:MaxRAMPercentage=75.0  -XX:InitialRAMPercentage=75.0  -XX:MinRAMPercentage=75.0"
#这里要设置百分比的方式哦
#CMD  java  -XX:+UseContainerSupport  -XX:MaxRAMPercentage=75.0  -XX:InitialRAMPercentage=75.0  -XX:MinRAMPercentage=75.0 -jar spring.jar